package com.xsdl.visitor.normal;

import java.util.List;
import java.util.Random;

public class Main {

    public static void main(String[] args) {
        List<String> types = List.of("A","B","C");
        String type = types.get(new Random().nextInt(3));
        Visit visit = new AVisitor();
        if (type.equals("A")) {
            visit = new AVisitor();
        }
        if (type.equals("B")) {
            visit = new BVisitor();
        }
        if (type.equals("C")) {
            visit = new CVisitor();
        }
        processVisit(visit);
    }

    private static void processVisit(Visit visit) {
        visit.visit();
    }

}
